🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / database / src / commonTest / kotlin / org / meshtastic / core / database / DatabaseManagerPoolTimeoutClassifierTest.kt
Displaying Raw • Download
core/database/src/commonTest/kotlin/org/meshtastic/core/database/DatabaseManagerPoolTimeoutClassifierTest.kt 41414f832f938b655c97bc07509bc140ea16e2a3 (41414f83) Text, 2.33 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.database
Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertFalse
Tff7b72import T7ee787kotlin.test.assertTrue
Tff7b72class T56d364DatabaseManagerPoolTimeoutClassifierTest Tb4b4b4{
Tf0883e@Test
Tff7b72fun Td2a8ff`matches Room reader connection acquire timeout`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3e Tff7b72= Te6edf3ExceptionTb4b4b4(Ta5d6ff"Ta5d6ffError code: 5, message: Timed out attempting to acquire a reader connection.Ta5d6ff"Tb4b4b4)
Te6edf3assertTrueTb4b4b4(Te6edf3DatabaseManagerTb4b4b4.Te6edf3isDbPoolAcquireTimeoutExceptionTb4b4b4(Te6edf3eTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`matches Room writer connection acquire timeout`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3e Tff7b72= Te6edf3ExceptionTb4b4b4(Ta5d6ff"Ta5d6ffError code: 5, message: Timed out attempting to acquire a writer connection.Ta5d6ff"Tb4b4b4)
Te6edf3assertTrueTb4b4b4(Te6edf3DatabaseManagerTb4b4b4.Te6edf3isDbPoolAcquireTimeoutExceptionTb4b4b4(Te6edf3eTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`matches when wrapped in a causal chain`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3root Tff7b72= Te6edf3ExceptionTb4b4b4(Ta5d6ff"Ta5d6ffError code: 5, message: Timed out attempting to acquire a reader connection.Ta5d6ff"Tb4b4b4)
Tff7b72val Te6edf3wrapper Tff7b72= Te6edf3RuntimeExceptionTb4b4b4(Ta5d6ff"Ta5d6ffDAO query failedTa5d6ff"Tb4b4b4, Te6edf3rootTb4b4b4)
Te6edf3assertTrueTb4b4b4(Te6edf3DatabaseManagerTb4b4b4.Te6edf3isDbPoolAcquireTimeoutExceptionTb4b4b4(Te6edf3wrapperTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`rejects generic connection locked`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3e Tff7b72= Te6edf3RuntimeExceptionTb4b4b4(Ta5d6ff"Ta5d6ffconnection locked by transport layerTa5d6ff"Tb4b4b4)
Te6edf3assertFalseTb4b4b4(Te6edf3DatabaseManagerTb4b4b4.Te6edf3isDbPoolAcquireTimeoutExceptionTb4b4b4(Te6edf3eTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`rejects non-DB timeout`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3e Tff7b72= Te6edf3RuntimeExceptionTb4b4b4(Ta5d6ff"Ta5d6ffTimed out attempting to acquire a BLE GATT connectionTa5d6ff"Tb4b4b4)
Te6edf3assertFalseTb4b4b4(Te6edf3DatabaseManagerTb4b4b4.Te6edf3isDbPoolAcquireTimeoutExceptionTb4b4b4(Te6edf3eTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tf0883e@Test
Tff7b72fun Td2a8ff`rejects plain database locked without acquire timeout`Tb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3e Tff7b72= Te6edf3ExceptionTb4b4b4(Ta5d6ff"Ta5d6ffdatabase is lockedTa5d6ff"Tb4b4b4)
Te6edf3assertFalseTb4b4b4(Te6edf3DatabaseManagerTb4b4b4.Te6edf3isDbPoolAcquireTimeoutExceptionTb4b4b4(Te6edf3eTb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s